package ws.jdbc.concurrent.driver.sqlserver.tds.datatypes;

import java.io.IOException;
import java.nio.ByteBuffer;

/**
 *
 * @author Wilson Santos, 36228 <wilson.santos@ua.pt>
 */
public abstract class TYPE_INFO {

  protected byte dataType;

  public abstract int read(ByteBuffer is) throws IOException;

  public abstract int size();

  public abstract byte[] getBytes();

  /**
   * Get the length of the variable-length {@code TYPE_INFO}.
   *
   * @return {@code TYPE_VARLEN} object that has the length,
   *                or {@code NULL} if the {@code TYPE_INFO} is fixed-length.
   */
  public abstract TYPE_VARLEN getTypeVarLen();

  public final byte getDataType() {
    return dataType;
  }
}
